package com.ccb.lms.service;

import java.sql.SQLException;
import java.util.List;

import com.ccb.lms.model.Book;
import com.ccb.lms.util.BasePage;

public interface IBookService {
	/**
	 * 增加一条记录
	 * @param book
	 * @return
	 * @throws SQLException
	 */
	public boolean insertBook(Book book) throws SQLException;   
	
	/**
	 * 删除一条记录
	 * @param bookNO
	 * @return
	 * @throws SQLException
	 */
	public boolean deleteBook(Integer bookNO) throws SQLException;
	
	/**
	 * 更新一条记录
	 * @param book
	 * @return
	 * @throws SQLException
	 */
	public boolean updateBook(Book book) throws SQLException;   
	
	/**
	 * 查询所有book记录
	 * @return
	 * @throws SQLException
	 */
	public List<Book> getAllBooks() throws SQLException; 
	
	/**
	 * 根据bookNO查询book
	 * @param bookNO
	 * @return
	 * @throws SQLException
	 */
	public Book getBookByNO(Integer bookNO) throws SQLException;
	
	/**获取记录条目数
	 * 
	 * @return
	 * @throws SQLException
	 */
	public int getBookCount() throws SQLException;
	
	/**
	 * 获得页面信息
	 * @param currentPage
	 * @param showRecordNum
	 * @return
	 * @throws SQLException
	 */
	public BasePage getBasePage(int currentPage,int showRecordNum) throws SQLException;
	
	/**
	 * 根据页面确定要显示的记录
	 * @param basePage
	 * @return
	 * @throws SQLException
	 */
	public List<Book> getBookByPage(BasePage basePage) throws SQLException;
	
	/**
	 * 根据书名确定要显示的记录
	 * @param bookName
	 * @return
	 * @throws SQLException
	 */
	public List<Book> getBookByName(String bookName) throws SQLException;
	
	/**
	 * 根据作者确定要显示的记录
	 * @param bookAuthor
	 * @return
	 * @throws SQLException
	 */
	public List<Book> getBookByAuthor(String bookAuthor) throws SQLException;
}
